<%@page import="java.awt.Button"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page import="doantotnghiep.model.Customer"%>
<%@taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<%@page import="java.util.ArrayList"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<script type="text/javascript">
	$(function() {
		$("#orderDateKey").datepicker();
	});
</script>

</head>
<body>
	<br>
	<br>
	<br>

	<div align="center">
			<h1 style="color: blue;">KẾT QUẢ TÌM KIẾM ĐƠN ĐẶT HÀNG</h1>
					<table class="table1" id="purchasetable">
						<tr>
							<th scope="col" abbr="Starter">Mã đơn đặt hàng</th>
							<th scope="col" abbr="Starter">Ngày Đặt Hàng</th>
							<th scope="col" abbr="Starter">Ngày giao hàng</th>
							<th scope="col" abbr="Starter">Nơi giao hàng</th>
							<th scope="col" abbr="Starter">Nhân viên lập đơn</th>
							<th scope="col" abbr="Starter">Khách hàng</th>

							<th scope="col" abbr="Starter"></th>
						</tr>

						<c:forEach items="${purchaseModel.purchaseDTOs}" var="purchase"
							varStatus="status">
							<tr class="<c:if test="${status.count % 2 == 0}">even</c:if>">
								<td>${purchase.orderID}</td>
								<td>${purchase.orderedDate}</td>
								<td>${purchase.deliveryDate}</td>
								<td>${purchase.deliveryLocation}</td>
								<td>${purchase.staffName}</td>
								<td>${purchase.customerName}</td>
								<td><a
									href="#" onclick="deletePurchase(${purchase.orderID})">
										<img src="<c:url value="/resources/images/delete-icon1.png"/>"/></a></td> 
								<td><a
									href="#" onclick="detailPurchase(${purchase.orderID})"> <img src="<c:url value="/resources/images/detail.jpg"/>"/></a></td> 
							</tr>
						</c:forEach>
	
					</table>
					 <div id="purchasepaging"></div> 
					<script type="text/javascript">
						var pager = new Pager('purchasetable', 7);
						pager.init();
						pager.showPageNav('pager', 'purchasepaging');
						pager.showPage(1);
					</script>
					<input class="button"
						id="closesearchpurchase" type="button" value="Đóng" />
</div>
</body>
</html>